import request from "@/utils/request";

//获取所有种类
export function cropAll() {
  return request({
    url: "/plant/crop/cropAll",
    method: "GET"
  });
}

//获取所有种类
export function cropAllAdmin() {
  return request({
    url: "/admin/crop/cropAll",
    method: "GET"
  });
}

//新增种类信息
export function addCrop(crop) {
  return request({
    url: '/admin/crop',
    method: "POST",
    data: crop
  });
}

//批量删除
// export function deleteCrop(id) {
//   return request({
//     url: "/admin/crop/" + id,
//     method: "delete"
//   });
// }


export function updateCrop(id) {
  return request({
    url: '/admin/crop/'+id,
    method: "get",
  });
}

export function updateCropAdmin(data) {
  return request({
    url: '/admin/crop',
    method: "PUT",
    data: data
  });
}


export function deleteCrop(id) {
  return request({
      url: '/admin/crop/' + id,
      method: 'delete'
  });
}